@using Mapster
@using BlazorApp.Pages.Common.Metadata
@using BlazorApp.Pages.Event
@using BlazorApp.Pages.Pod
@using BlazorApp.Pages.Common.Html.HTable
@using BlazorApp.Pages.Common
@using k8s.Models
@inherits BlazorApp.Pages.Common.DrawerPageBase<k8s.Models.V1Namespace>
@if (Namespace != null)
{
    <NamespaceAction Item="Namespace" MenuMode="MenuMode.Horizontal"></NamespaceAction>
    <Divider Orientation="left" Style="font-weight:bold">@L["Metadata"]</Divider>
    <MetadataView Item="Namespace.Metadata" ExplainFieldPrefix="namespace"></MetadataView>
    <Divider Orientation="left" Style="font-weight:bold">@L["Spec"]</Divider>
    <HTable Bordered Column="1">
        <PropertyListView Title=@L["Finalizers"] Items="@Namespace.Spec.Finalizers" ExplainField="namespace.spec.finalizers" T="string"></PropertyListView>
    </HTable>
    <Divider Orientation="left" Style="font-weight:bold">@L["Status"]</Divider>
    <HTable Bordered Column="1">
        <ConditionsView Conditions="@(Namespace.Status.Conditions.Adapt<IList<V1Condition>>())" ExplainField="namespace.status.conditions"></ConditionsView>
        <PropertyOptionView Title=@L["Phase"] Item="@Namespace.Status.Phase" ExplainField="namespace.status.phase" Options="@(new[] { "Active", "Terminating" })"></PropertyOptionView>
    </HTable>

    <MiniPodListView Pods="@PodList"></MiniPodListView>

    <MiniEventListView Uid="@Namespace.Metadata.Uid"></MiniEventListView>
}
